package jin.si.com.utils;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * @description: 定时器
 * @ClassName TestTask
 * @Author MT
 * @Date 2021/5/25 10:25
 **/

@Component
public class TestTask {

    //每隔几秒执行一次
    //@Scheduled(fixedRate =2000)
    //@Scheduled(initialDelay = 1000,fixedRate =2000)
    //@Scheduled(cron = "0/1 * * * * *")
    public void sum(){
        //System.out.println(LocalDate.now()+"当前金额"+Math.random()*1000)
        /*for(int a=0;a<10;a++){
            System.out.println("在"+LocalDateTime.now()+"的时间。付氏残留人数还有"+Math.floor(Math.random()*1000)+"人");
        }*/
        System.out.println("*****************************************");
    }

}
